@model NITASA.ViewModels.CL_Label
@using NITASA.Helpers
@{
    string currentThemeName = ViewBag.ActiveTheme;
    Layout = currentThemeName + "/master.cshtml";
    ViewBag.Title = Model.Name;
}
<div id="subheader">
    <div class="row">
        <div class="eight columns">
            <p class="bread leftalign">
                @Model.Name
            </p>
        </div>
        <div class="four columns">
            @Html.Partial("~" + currentThemeName + "/search_form.cshtml")
        </div>
    </div>
</div>
<div class="hr">
</div>
<div class="row">
    <div class="twelve columns noleftmargin">
        <!-- MAIN CONTENT -->
        <div class="eight columns noleftmargin">
            @foreach (var item in Model.Posts)
            {
                <div class="four columns">
                    <div class="boxblog" style="word-break: break-all;">
                        <h5><a href="/Content/@item.URL">@item.Title</a></h5>
                        <p class="small date">
                            Posted on:@Functions.FormatDate(item.PublishedOn, "dd MMM yyyy")
                            <span class="has-tip tip-top" data-width="90" title="@item.CommentsCount comments"><img src="@currentThemeName/images/comments.png" alt=""></span>
                        </p>
                        <p>
                            @{string Description = Functions.RemoveHTMLTags(item.Description);}
                            @(Description.Length > 156 ? Description.Substring(0, 153) + "..." : Description)
                        </p>
                        <p>
                            <a href="/Content/@item.URL" class="small continue">Continue reading</a>
                        </p>
                    </div>
                </div>
            }
            @if (Model.Posts.Count() > 0)
            {
                <br class="clear"/>
                @Html.Partial("~" + currentThemeName + "/pager.cshtml", Model.Pager)
            }
            else
            {
                <h5>No post found...</h5>
            }
        </div>
        <!-- SIDEBAR -->
        @Html.Partial("~" + currentThemeName + "/sidebar.cshtml")
    </div>
</div>
<div class="hr">
</div>
